package com.my.study.anno.driven.life;

import org.springframework.beans.BeansException;
import org.springframework.beans.factory.DisposableBean;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.config.BeanPostProcessor;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;

/**
 * @author Carlos
 * @version 1.0
 * @Description TODO
 * @date 2021/11/23 8:31
 **/
@Component
public class Tea implements InitializingBean, DisposableBean {

    public Tea() {
        System.out.println("tea constructor...");
    }


    @PostConstruct
    public void postConstruct() {
        System.out.println("postConstruct...");
    }

    @Override
    public void afterPropertiesSet() throws Exception {
        System.out.println("afterPropertiesSet...");
    }

    @PreDestroy
    public void preDestroy() {
        System.out.println("preDestroy...");
    }

    @Override
    public void destroy() throws Exception {
        System.out.println("destroy...");
    }
}
